package conf

import (
	"github.com/spf13/viper"
	"go.uber.org/zap"
)

// WebSection map toml [web]
type WebSection struct {
	Host string
	Port string
}

// ReadWeb get grpc section from config
func ReadWeb(v *viper.Viper, slog *zap.SugaredLogger) (webConfPtr *WebSection) {
	webConfPtr = &WebSection{}
	err := v.Unmarshal(webConfPtr)
	if err != nil {
		slog.Panicf("unable to decode into web section, %v", err)
	}
	return
}
